/**
 * Copyright (c) 2008,中企动力华南研发中心 All rights reserved.
 */
package com.ce.util;

import com.sitechasia.webx.core.utils.populator.ConverterFactory;
import com.sitechasia.webx.core.utils.populator.IPopulator;

import com.sitechasia.webx.core.utils.populator.WebXPopulator;

/**
 * 逻辑、功能相关描述:上传工具类辅助类
 *
 * @author 申定溪 编写日期：2008-1-21
 */

public class MultipartPopulateUtil {

	public MultipartPopulateUtil() {}

	public static IPopulator getDefaultPopulator()
    {
        return populator;
    }

    private static final IPopulator populator;

    static
    {
        WebXPopulator webxPop = new WebXPopulator();
        MultipartRequestBeanPopulator requestPop = new MultipartRequestBeanPopulator();
        requestPop.setConverter(ConverterFactory.getDefaultConverter());
        webxPop.getPopulators().add(requestPop);
        populator = webxPop;
    }

    public static boolean populate(Object source, Object target)
    {
        return getDefaultPopulator().populate(source, target, null, null);
    }
}
